<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class BookRulePrice
 * @package App\Models
 */
class BookRulePrice extends Model
{
    protected $fillable = [
        'total_price',
        'rule_id',
        'category_id'
    ];

    protected $casts = [
        'total_price'=>'float'
    ];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function category()
    {
        return $this->hasOne(PriceCategory::class, 'id', 'category_id');
    }
}